package com.mutouren.web.databind;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.core.convert.converter.Converter;

public class DateConverter implements Converter<String, Date> {

	@Override
	public Date convert(String source) {
		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
		dateFormat.setLenient(false);
		try {
			return dateFormat.parse(source);
		} catch (Throwable t) {
			//throw ExceptionUtils.doUnChecked(t);
			//t.printStackTrace();
			return null;			
		}
	}

}